
/**
 * AppleIIGo
 * RamWorks class
 * (C) 2007-2008 by Marc S. Ressl (mressl@umich.edu)
 * Released under the GPL
 */

#ifndef RAMWORKS_H
#define RAMWORKS_H

#include "AuxSlotDevice.h"

#define RAMWORKS_BANKSELECT_END 0x100

class RamWorks : public AuxSlotDevice {
public:
	RamWorks(class Motherboard * motherboard);
	
	void onDevicesConnected();
	void onMemoryRequested();
	void onMemoryAllocated();
	void onResetAsserted(bool isRestart);
	
	void writeIo(UINT16 address, UINT8 value);
	UINT8 readIo(UINT16 address);
	
protected:
	UINT32 bankNum;
	UINT8 * bankMap;
	
private:
	class MMU * mmu;
	
	UINT32 memoryOffset;
	
	UINT8 bankSelect;
	UINT32 bankSelectToMemoryOffset[RAMWORKS_BANKSELECT_END];
	
	void setBankSelect(UINT8 value);
};

#endif
